package com.nami.message.app.convertor;

import com.nami.message.domain.model.pmsg.PChatMsgModel;
import com.nami.message.facade.pmsg.request.PrivateMsgAddCmd;

public class PrivateCmd2DomainConvertor {


    public static PChatMsgModel toDomain(PrivateMsgAddCmd cmd) {
        if (cmd == null) {
            return null;
        }


        PChatMsgModel msgDomain = new PChatMsgModel();
        msgDomain.setAppKey(cmd.getAppKey());

        msgDomain.setMessageId(cmd.getMessageId());

        msgDomain.setClientMsgId(cmd.getClientMsgId());

        msgDomain.setCid(cmd.getCid());
        msgDomain.setSenderId(cmd.getSenderId());
        msgDomain.setReceiverId(cmd.getReceiverId());
        msgDomain.setType(cmd.getType());
        msgDomain.setPayload(cmd.getPayload());
        msgDomain.setPayloadType(cmd.getPayloadType());

        msgDomain.setSendTime(cmd.getSendTime());
        msgDomain.setSeq(cmd.getSeq());
        return msgDomain;
    }

}
